// 学号：202102905
// 姓名：熊月枫
package com.company;

import java.awt.*;

public class UML {
    public static void main(String[] args) {
        Student  xiaoMing = new Student("123","小明","男","20210122222","8班","90");
        Student  xiaoHui = new Student("234","小辉","男","20210174527","4班","99");
        Student  xiaoHong = new Student("234","小红","女","20210171721","1班","100");
        Teacher  huang = new Teacher("124","黄梅","男","20180727452","班主任","200");
        Teacher  deng = new Teacher("124","邓哲","男","20140452748","数学老师","150");
        Policeman feng = new Policeman("125","冯雷","女","8952","刑事部","二级警员");
        Policeman li = new Policeman("125","李颖","女","4821","刑事部","二级警员");
        System.out.println(xiaoMing);
        xiaoMing.lesson();
        xiaoMing.test();

        System.out.println(xiaoHui);
        xiaoHui.lesson();
        xiaoHui.test();

        System.out.println(xiaoHong);
        xiaoHong.lesson();
        xiaoHong.test();

        System.out.println(huang);
        huang.lecture();
        huang.review();

        System.out.println(deng);
        deng.lecture();
        deng.review();

        System.out.println(feng);
        feng.work();
        feng.train();

        System.out.println(li);
        li.work();
        li.train();

        Student.count();
        Teacher.count();
        Policeman.count();
    }
}

class Person{
    public String cardNum;
    public String name;
    public String sex;

    public Person(String cardNum, String name, String sex) {
        super();
        this.cardNum = cardNum;
        this.name = name;
        this.sex = sex;
    }

    public Person() {
        super();
    }
    public void eat(){
        System.out.println("我要吃饭");
    }

    public void sleep(){
        System.out.println("我要睡觉");
    }

    public void walk(){
        System.out.println("我要走路");
    }



    @Override
    public String toString() {
        return "Person [cardNum=" + cardNum + ", name=" + name + ", sex=" + sex + "]";
    }
}

class Student extends Person{
    private String id,classroom,score;
    private static int count = 0;

    public String getId(){
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getClassroom() {
        return classroom;
    }

    public void setClassroom(String classroom) {
        this.classroom = classroom;
    }

    public Student() {
    }
    public Student(String cardNum, String name, String sex, String id, String classroom, String score) {
        super(cardNum, name, sex);
        this.id = id;
        this.classroom = classroom;
        this.score = score;
        count++;
    }

    @Override
    public String toString() {
        return "Student [cardNum=" + super.cardNum + ", name=" + super.name + ", sex=" + super.sex + ", id=" + id + ",  classroom=" + classroom + ", " + "score=" + score+ "]";
    }

    public void lesson(){
        System.out.println("我要在" + classroom + "上课");
    }

    public void test(){
        System.out.println("我考试得了" + score + "分");
    }

    public static void count(){
        System.out.println("学生count=" + count);
    }
}

class Teacher extends Person{
    private String id,position,salaryNum;
    private static int count = 0;

    public String getId(){
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
    public String getPosition(){
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public String getSalaryNum(){
        return salaryNum;
    }

    public void setSalaryNum(String salaryNum) {
        this.salaryNum = salaryNum;
    }

    public Teacher() {
    }
    public Teacher(String cardNum, String name, String sex, String id, String position, String salaryNum) {
        super(cardNum, name, sex);
        this.id = id;
        this.position = position;
        this.salaryNum = salaryNum;
        count++;
    }
    @Override
    public String toString() {
        return "Teacher [cardNum=" + super.cardNum + ", name=" + super.name + ", sex=" + super.sex + ", id=" + id + ",  position=" + position + ", " + "salaryNum=" + salaryNum+ "]";
    }

    public void lecture(){
        System.out.println("我要给学生讲课");
    }

    public void review(){
        System.out.println("我要批阅试卷");
    }

    public static void count(){
        System.out.println("老师count=" + count);
    }
}

class Policeman extends Person{
    private String id,department,rank;
    private static int count = 0;

    public String getId(){
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
    public String getDepartment(){
        return department;
    }

    public void setDepartment(String department) {
        this.department = department;
    }

    public String getRank(){
        return rank;
    }

    public void setRank(String rank) {
        this.rank = rank;
    }

    public Policeman() {
    }
    public Policeman(String cardNum, String name, String sex, String id, String department, String rank) {
        super(cardNum, name, sex);
        this.id = id;
        this.department = department;
        this.rank = rank;
        count++;
    }
    @Override
    public String toString() {
        return "Policeman [cardNum=" + super.cardNum + ", name=" + super.name + ", sex=" + super.sex + "id=" + id + ",  department=" + department + ", " + "rank=" + rank+ "]";
    }

    public void work(){
        System.out.println("我要执勤");
    }

    public void train(){
        System.out.println("我要训练");
    }

    public static void count(){
        System.out.println("警察count=" + count);
    }
}